home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Programming / Scalos / Developer / Autodoc / iconobject_dtc.doc next >
Encoding:
Text File  |  1998-01-04  |  5.9 KB  |  194 lines

  1. TABLE OF CONTENTS
  2.  
  3. iconobject.datatype/--background--
  4. iconobject.datatype/iconobject.datatype
  5. iconobject.datatype/--background--          iconobject.datatype/--background--
  6.  
  7.     PURPOSE
  8.     The iconobject.datatype has a special API to work with icons. It makes
  9.     both images , tooltypes and many more available.
  10.  
  11.     FUNCTION
  12.     The iconobject.datatype has some special method to draw images and
  13.     writing icons. It is also compatible to gadgets methods. You can use
  14.     datatypes.library or iconobject.library to create objects. The icon-
  15.     object.library is much faster.
  16.     After creating an object the gadget.left and gadget.top fields are
  17.     filled with the saved iconposition. The GA_LEFT,GA_TOP,GA_WIDTH and
  18.     GA_HEIGHT tags are ignored. They have to be set after creating the obj-
  19.     ect if you like to change them.
  20.     Before using the IDTM_Draw method you have to use IDTM_Layout. The
  21.     IDTM_Layout method will generate the images and probably changing the
  22.     size. The extgadget.bounds field of the return object hold the position
  23.     and the whole size (including the text) and the position. The gadget
  24.     size infos are only the image size. The size may change after layouting
  25.     if you setup a inneroffset. The gadget.left/top field may be
  26.     IO_NOPOSITION. If you use an iconobject as gadget you don't need to
  27.     layout it, this will be done automatically.
  28.     The textcolor and the drawmode you like have to be set in the rastport
  29.     before drawing.
  30.  
  31.     CREATING SUBDATATYPES
  32.         OM_NEW
  33.             You have to open the icon and then you should set some
  34.             attributes to the superclass (e.g. Tooltypes). Set the
  35.             position and the size in the gadget struct. If you like
  36.             to have a transparent icon then set the IDTA_Mask_..
  37.             tags before the IDTM_Layout method.
  38.  
  39.         OM_DISPOSE
  40.             Free your icon.
  41.  
  42.         IDTM_Layout
  43.             After calling the superclass you can get the
  44.             gadget.gadgetrender and selectrender. These are filled
  45.             with a pointer to a rastport or NULL. Get the
  46.             IDTA_InnerLeft and IDTA_InnerTop attributes and draw
  47.             your image into the rastport. The bitmap in the rastport
  48.             may be a 15/16 or 24bit bitmap. You can use
  49.             cybergraphics.library to access it. Check the
  50.             layout.flags to know which image you should generate.
  51.  
  52.         IDTM_Write
  53.             Generate a icon from the icon object and write it to
  54.             disk.
  55.  
  56.         IDTA_Extention
  57.             Set the extention of your icons or NULL if they have
  58.             none.
  59.  
  60.     USING ICONOBJECT-DATATYPES
  61.  
  62.  
  63. iconobject.datatype/iconobject.datatype iconobject.datatype/iconobject.datatype
  64.  
  65.     NAME
  66.     iconobject.datatype -- root data type for iconobject.
  67.  
  68.     FUNCTION
  69.     The iconobject.datatype is the super-class of all iconobjects.
  70.  
  71.     METHODS
  72.     OM_NEW -- Create a new iconobject.
  73.  
  74.     OM_GET -- Obtain the value of an attribute.
  75.  
  76.     OM_SET -- Set the values of multiple attributes.
  77.  
  78.     GM_HITTEST -- Determine if the object has been hit with the
  79.         mouse. If the image has a mask, the iconobject will check if the
  80.         click is insite of this mask.
  81.  
  82.     GM_RENDER -- Cause the graphic to render.
  83.  
  84.     IDTM_Layout -- layout the iconobject, it *MUST* be used before using the
  85.                    ITDM_Draw method
  86.  
  87.     IDTM_Draw -- draw the whole icon to the rastport given in the io_draw
  88.                  struct. The gadget flag SELECTED will determinate the if
  89.                  the unselected or selected image will be drawn.
  90.  
  91.     IDTM_Write -- write the icon to disk
  92.  
  93.     IDTM_FindToolType -- find a tooltype
  94.  
  95.     IDTM_GetToolTypeValue -- get a value from a tooltype
  96.  
  97.     IDTM_FreeLayout -- free the layout. This should be used if you change
  98.                        the screen. You can use IDTM_Layout after this
  99.                        method.
  100.  
  101.  
  102.     TAGS
  103.     IDTA_Type (ULONG) -- icontype (see icon.library/diskobject)
  104.         Applicability is (ISG).
  105.  
  106.     IDTA_Text (*CHAR) -- icon text, will normally displayed under the icon
  107.                          if you set this attribute you have to relayout the
  108.                          iconobject.
  109.  
  110.         Applicability is (ISG).
  111.  
  112.     IDTA_DefaultTool (CHAR *) -- default tool
  113.  
  114.         Applicability is (ISG).
  115.  
  116.     IDTA_WindowRect (struct IBox *) -- the window position and size if the
  117.                                        icontype is disk/drawer/trashcan
  118.  
  119.         Applicability is (ISG).
  120.  
  121.     IDTA_ToolTypes (APTR *) -- tooltype array
  122.  
  123.         Applicability is (ISG).
  124.  
  125.     IDTA_Stacksize (ULONG) -- stacksize
  126.  
  127.         Applicability is (ISG).
  128.  
  129.     IDTA_InnerLeft (ULONG)
  130.     IDTA_InnerTop (ULONG)
  131.     IDTA_InnerRight (ULONG)
  132.     IDTA_InnerBottom (ULONG) -- inner offset to the iconimage, you need to
  133.                                 relayout the icon after changing this
  134.                                 attribute
  135.  
  136.         Applicability is (ISG).
  137.  
  138.     IDTA_FrameType (ULONG)
  139.     IDTA_FrameTypeSel (ULONG) -- frametype for the unselected and selected
  140.                                  image
  141.     
  142.         Applicability is (ISG).
  143.  
  144.     IDTA_WinCurrentX (LONG)
  145.     IDTA_WinCurrentY (LONG) -- virtual inneroffset of the window to open
  146.  
  147.         Applicability is (ISG).
  148.  
  149.     IDTA_LayoutFlags (ULONG) -- find out what's already layouted
  150.         Applicability is (..G).
  151.  
  152.     IDTA_Extention (CHAR *) --  the icon-extention or NULL
  153.         Applicability is (..G).
  154.  
  155.     IDTA_Mask_Normal (BYTE *)
  156.     IDTA_Mask_Selected (BYTE *) -- the image mask, the width is rounded by
  157.                                    16. It one planar bitplane.
  158.  
  159.         Applicability is (ISG).
  160.  
  161.     IDTA_Flags (ULONG) -- icon flags (e.g. ShowAllFiles)
  162.  
  163.         Applicability is (ISG).
  164.  
  165.     IDTA_ViewModes -- viewmodes for the window to open
  166.  
  167.         Applicability is (ISG).
  168.  
  169.     IDTA_DefType (ULONG) -- defaulticon type (see icon.library/diskobject)
  170.  
  171.         Applicability is (I..).
  172.  
  173.     IDTA_TextPen (ULONG) -- colorpen for the outline around the text
  174.  
  175.         Applicability is (ISG).
  176.  
  177.     IDTA_TextMode (ULONG) -- the textmode (e.g. Outline)
  178.  
  179.         Applicability is (ISG).
  180.  
  181.     IDTA_TextSkip (ULONG) -- space in pixels between the text and the image
  182.  
  183.         Applicability is (ISG).
  184.  
  185.     IDTA_HalfShadowPen (ULONG) -- MagicWB halfshadow pen, needed for some
  186.                                   frames
  187.  
  188.         Applicability is (ISG).
  189.  
  190.     IDTA_HalfShinePen (ULONG) -- MagicWB halfshine pen, need for some frames
  191.         Applicability is (ISG).
  192.  
  193.  
  194.